package day07;

import java.util.Arrays;

public class txt11 {
    public static void main(String[] args) {
        int[]a={1,2,3,4,5};
        int index1=2;
        int index2=4;
        change(a,index1,index2);
        System.out.println(Arrays.toString(a));
    }

    static void change(int[]a,int index1,int index2){
        int temp=a[index1];
        a[index1]=a[index2];
        a[index2]=temp;
        System.out.println(Arrays.toString(a));
    }
}
